#include "LightManager.h"


LightManager::LightManager(void)
{
	// Ambient light
	m_lightAmbient[0] = 0.5f;
	m_lightAmbient[1] = 0.5f;
	m_lightAmbient[2] = 0.5f;
	m_lightAmbient[3] = 1.0f;

	// Diffuse light
	m_lightDiffuse[0] = 1.0f;
	m_lightDiffuse[1] = 1.0f;
	m_lightDiffuse[2] = 1.0f;
	m_lightDiffuse[3] = 1.0f;

	// Light position
	m_lightPosition[0] = 0.0f;
	m_lightPosition[1] = 0.0f;
	m_lightPosition[2] = 2.0f;
	m_lightPosition[3] = 1.0f;
}

LightManager::~LightManager(void)
{
}

void LightManager::Init()
{
	// Set up the ambient light
	glLightfv(GL_LIGHT0, GL_AMBIENT, m_lightAmbient);
	// Set up the diffuse light
	glLightfv(GL_LIGHT0, GL_DIFFUSE, m_lightDiffuse);
	// Position the light
	glLightfv(GL_LIGHT0, GL_POSITION, m_lightPosition);

	// Enable light 0
	glEnable(GL_LIGHT0);
}
